<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增课程包')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-package-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">周名称：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text">
                    <input name="parentId"  type="hidden" th:value="${id}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">排序：</label>
                <div class="col-sm-8">
                    <input name="orderNum" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/package"
        $("#form-package-add").validate({
            focusCleanup: true
        });
        var time = 0;
        function submitHandler() {
            if (time==0) {
                if ($.validate.form()) {
                    time = 1;
                    $.operate.save(prefix + "/add", $('#form-package-add').serialize());
                }
            }
        }

        $("input[name='created']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='avaliableDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='lastUpdated']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>